﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/design.Master" CodeBehind="tips.aspx.vb" Inherits="CakeThatIBaked.tips" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

 

<div class = "theheader">
Cake Tips
</div>

<!-- Script Manager -->
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<!-- Update Panel -->
<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>
<!-- Main Container -->

<div id="container">

<!-- Tip Container -->
<div id="tipscont">
    <asp:Button ID="Button1" runat="server" Text="Like This Tip" />
<!-- List View -->
    <asp:ListView ID="ListView1" runat="server" DataKeyNames="ID" DataSourceID="TipsDataSource">
    <ItemTemplate>
        <div class = "tipdisplaytips">
            <asp:LinkButton ID="LB_Tips" runat="server" commandName="Select" CssClass="linkbtn" >
            <asp:Label ID="TipTitleLabel" runat="server" Text=<%# Eval("TipDescription") %> CssClass="linkbtn" />
            </asp:LinkButton></div></ItemTemplate>
            
            
            <SelectedItemTemplate>
<div class = "tipdispalytipsselected">
<asp:Label ID="TipTitleLabel" runat="server" Text=<%# Eval("TipDescription") %> CssClass="linkbtn" /><br />
<%# getlink()%> 
<br />
<asp:Repeater ID="tipCommentRepeater" runat="server" DataSourceID="SqlDataSource2">

<HeaderTemplate>
<ol class="commentlist">
</HeaderTemplate>

<ItemTemplate>
    
<li class = "commentblock">
<div class="pictureholder">
<img src=<%# Eval("ProfilePic") %> width=80 height=80 />
</div>
<%# Eval("Comment")%>
</li>

</ItemTemplate>

<AlternatingItemTemplate>
<li class = "commentblock2">
<div class="pictureholder">
<img src=<%# Eval("ProfilePic") %> width=80 height=80 />
</div>
<%# Eval("Comment")%>
</li>
</AlternatingItemTemplate>

<FooterTemplate>
    </ol>
</FooterTemplate>

</asp:Repeater>

</div>
</SelectedItemTemplate>


<LayoutTemplate>
 <div style="font-family: Verdana, Arial, Helvetica, sans-serif;" ID="itemPlaceholderContainer" runat="server">
 <span runat="server" id="itemPlaceholder" />
 </div>
 <div style="text-align: center;background-color: #5D7B9D;font-family: Verdana, Arial, Helvetica, sans-serif;color: #FFFFFF;">
 <asp:DataPager ID="DataPager1" runat="server">
 <Fields>
 <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="False" ShowLastPageButton="False" />
 </Fields>
 </asp:DataPager>
 </div>
 </LayoutTemplate>


</asp:ListView>
<!-- End List View -->
</div>
<!-- End Tip Container -->
</div>
<!-- End Main Container -->
</ContentTemplate>
</asp:UpdatePanel>
<!-- End Update Panel -->
<!-- SQL Datasources -->

<asp:SqlDataSource ID="TipsDataSource" runat="server" 
ConnectionString="<%$ ConnectionStrings:CakeConnection %>" 
ProviderName="<%$ ConnectionStrings:CakeConnection.ProviderName %>" 
SelectCommand="SELECT [TipTitle], [Author], [TipDescription], [TipRating], [ID] FROM [Tips]">
</asp:SqlDataSource>

<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
ConnectionString="<%$ ConnectionStrings:CakeConnection %>" 
ProviderName="<%$ ConnectionStrings:CakeConnection.ProviderName %>" 
SelectCommand="SELECT [T_FID], [UserName], [ProfilePic], [Comment], [DateAdded] FROM [TipComments] WHERE ([T_FID] = ?)"><SelectParameters><asp:ControlParameter 
ControlID="ListView1" Name="T_FID" PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>

</asp:Content>
